GTK_TREE_MODEL_ROW,
};
+#define DEFAULT_RECENT_FILES_LIMIT 50
+
/* Icon size for if we can't get it from the theme */
#define FALLBACK_ICON_SIZE 16
g_free (load_data);
}
-static gint
-get_recent_files_limit (GtkWidget *widget)
-{
- GtkSettings *settings;
- gint limit;
-
- if (gtk_widget_has_screen (widget))
- settings = gtk_settings_get_for_screen (gtk_widget_get_screen (widget));
- else
- settings = gtk_settings_get_default ();
-
- g_object_get (G_OBJECT (settings), "gtk-recent-files-limit", &limit, NULL);
-
- return limit;
-}
-
/* Populates the file system model with the GtkRecentInfo* items in the provided list; frees the items */
static void
populate_model_with_recent_items (GtkFileChooserDefault *impl, GList *items)
GList *l;
int n;
- limit = get_recent_files_limit (GTK_WIDGET (impl));
+ limit = DEFAULT_RECENT_FILES_LIMIT;
n = 0;
* GtkRecentChooser:limit:
*
* The maximum number of recently used resources to be displayed,
- * or -1 to display all items. By default, the
- * GtkSetting:gtk-recent-files-limit setting is respected: you can
- * override that limit on a particular instance of #GtkRecentChooser
- * by setting this property.
+ * or -1 to display all items.
*
* Since: 2.10
*/
P_("The maximum number of items to be displayed"),
-1,
G_MAXINT,
- -1,
+ 50,
GTK_PARAM_READWRITE));
/**
* GtkRecentChooser:sort-type:
#define NUM_CHARS 40
#define NUM_LINES 9
+#define DEFAULT_RECENT_FILES_LIMIT 50
+
\f
/* GObject */
static GtkIconTheme *get_icon_theme_for_widget (GtkWidget *widget);
static gint get_icon_size_for_widget (GtkWidget *widget,
GtkIconSize icon_size);
-static gint get_recent_files_limit (GtkWidget *widget);
static void reload_recent_items (GtkRecentChooserDefault *impl);
static void chooser_set_model (GtkRecentChooserDefault *impl);
GTK_ICON_SIZE_BUTTON);
if (!impl->priv->limit_set)
- impl->priv->limit = get_recent_files_limit (widget);
+ impl->priv->limit = DEFAULT_RECENT_FILES_LIMIT;
set_busy_cursor (impl, TRUE);
return FALLBACK_ICON_SIZE;
}
-static gint
-get_recent_files_limit (GtkWidget *widget)
-{
- GtkSettings *settings;
- gint limit;
-
- if (gtk_widget_has_screen (widget))
- settings = gtk_settings_get_for_screen (gtk_widget_get_screen (widget));
- else
- settings = gtk_settings_get_default ();
-
- g_object_get (G_OBJECT (settings), "gtk-recent-files-limit", &limit, NULL);
-
- return limit;
-}
-
static void
recent_manager_changed_cb (GtkRecentManager *manager,
gpointer user_data)
* -1 means every recently used file stored.
*
* Since: 2.12
+ *
+ * Deprecated: 3.10: This setting is ignored
*/
result = settings_install_property_parser (class,
g_param_spec_int ("gtk-recent-files-limit",
P_("Number of recently used files"),
-1, G_MAXINT,
50,
- GTK_PARAM_READWRITE),
+ GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
NULL);
g_assert (result == PROP_RECENT_FILES_LIMIT);